package com.iteaj.iot.builder;

import com.iteaj.iot.AbstractProtocolTimeoutManager;
import com.iteaj.iot.FrameworkComponent;
import com.iteaj.iot.ProtocolHandle;
import com.iteaj.iot.codec.filter.Filter;
import com.iteaj.iot.event.StatusEventListener;

public interface Builder<C extends FrameworkComponent, L extends StatusEventListener> {

    /**
     * 事件监听
     * @param listener
     * @return
     */
    Builder listener(L listener);

    /**
     * 注册组件
     * @return
     */
    ComponentBuilder<? extends ProtocolHandle, ? extends Filter> register(C component);

    /**
     * 自定义超时管理器
     * @param timeoutManager
     * @return
     */
    Builder customize(AbstractProtocolTimeoutManager timeoutManager);
}
